import logging

logger = logging.getLogger("assert")

def assert_all(validate_value: dict):
    logger.info(f"准备开始断言：{validate_value}")

    for assert_type, assert_data in validate_value.items():
        logger.info(f"断言类型：{assert_type}")
        for assert_msg, a_b_data in assert_data.items():
            a = str(a_b_data[0])
            b = str(a_b_data[1])
            logger.info(f"断言提示：{assert_msg}")
            logger.info(f"断言提示：{a_b_data}")

            if assert_type == 'equals':
                assert a == b, assert_msg
            elif assert_type == 'not_equals':
                assert a != b, assert_msg
            elif assert_type == 'in':
                assert a in b, assert_msg
            elif assert_type == 'no_in':
                assert a not in b, assert_msg
            logger.info("本次断言通过")

    logger.info("所有断言全部通过")